import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["key", "tab", "tabKey", "disabled", "destroyInactiveTabPane", "children", "className", "style", "cardProps"];
import { jsx as _jsx } from "react/jsx-runtime";
import { ConfigProvider, Tabs } from 'antd-v4';
import classNames from 'classnames';
import { useContext } from 'react';
import Card from '../Card';
import './index.less';

var TabPane = function TabPane(props) {
  var key = props.key,
      tab = props.tab,
      tabKey = props.tabKey,
      disabled = props.disabled,
      destroyInactiveTabPane = props.destroyInactiveTabPane,
      children = props.children,
      className = props.className,
      style = props.style,
      cardProps = props.cardProps,
      rest = _objectWithoutProperties(props, _excluded);

  var _useContext = useContext(ConfigProvider.ConfigContext),
      getPrefixCls = _useContext.getPrefixCls;

  var prefixCls = getPrefixCls('pro-card-tabpane');
  var tabPaneClassName = classNames(prefixCls, className);
  return _jsx(Tabs.TabPane, _objectSpread(_objectSpread({
    tabKey: tabKey,
    tab: tab,
    className: tabPaneClassName,
    style: style,
    disabled: disabled,
    destroyInactiveTabPane: destroyInactiveTabPane
  }, rest), {}, {
    children: _jsx(Card, _objectSpread(_objectSpread({}, cardProps), {}, {
      children: children
    }))
  }), key);
};

export default TabPane;